<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<!-- 使用UTF-8 -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<!-- 设置移动终端可视区域 -->
		<meta content="telephone=no" name="format-detection">
		<!-- 禁止iPhone等手机自动将数字变成可点击的拨号连接 -->
		<title>列表详情</title>
		<link href="css/style.css" type="text/css" rel="stylesheet" />
		<link href="css/weui.css" type="text/css" rel="stylesheet" />
	</head>
	<body style="background: #F6F6F6;">
		<div class="detail" id="containerVue" v-cloak>
      <div v-show="showBanner==1" class="headerView">
        <i onclick="closeView()">&#139;</i>
        <h1>"966588"查询系统</h1>
        <div></div>
      </div>
      <div v-show="showBanner==0" style="background: #fff;" class="headerView">
        <i style="color:#0787d5" onclick="closeView()">&#139;<span style="color:#0787d5;font-size: 1rem;position: relative;bottom: 0.1rem;">返回</span></i>
      </div>
			<div class="title">{{info.name}}</div>
			<div class="cont">
				<div class="li" v-if="info.nature">
					<div class="left">工程性质</div>
					<div class="right">{{info.nature}}</div>
				</div>
				<div class="li">
					<div class="left">接件人姓名</div>
					<div class="right">{{info.busUserName}}</div>
				</div>
				<div class="li">
					<div class="left">接件人电话</div>
					<div class="right">{{info.contactPhone}}</div>
				</div>
				<div class="li">
					<div class="left">部门名称</div>
					<div class="right">{{info.deptName}}</div>
				</div>
				<div class="li" v-if="info.leaderName">
					<div class="left">项目负责人</div>
					<div class="right">{{info.leaderName}}</div>
				</div>
				<div class="li">
					<div class="left">开始日期</div>
					<div class="right">{{info.startTime}}</div>
				</div>
				<div class="li">
					<div class="left">计划完成日期</div>
					<div class="right">{{info.planCompletedTime}}</div>
				</div>
        <div class="li">
          <div class="left">实际完成日期</div>
          <div class="right">{{info.realCompletedTime}}</div>
        </div>
        <div class="li" v-if="info.fxStartTime">
          <div class="left">放线通知单时间</div>
          <div class="right">{{info.fxStartTime}}</div>
        </div>
        <div class="li" v-if="info.fxStartTime">
          <div class="left">放线回执单时间</div>
          <div class="right">{{info.fxEndTime}}</div>
        </div>
				<div class="li">
					<div class="left">委托联系人</div>
					<div class="right">{{info.wtr}}</div>
				</div>
				<div class="li">
					<div class="left">联系电话</div>
					<div class="right">{{info.wtlxr}}</div>
				</div>
				<div class="li">
					<div class="left">委托单位</div>
					<div class="right">{{info.wtdw}}</div>
				</div>
				<div class="li">
					<div class="left">项目节点</div>
					<div class="right">
						<span v-if="info.projectNode == null">未进场</span>
						<span v-else-if="info.projectNode == 0">资料准备和外业生产</span>
						<span v-else-if="info.projectNode == 1">内业生产</span>
						<span v-else-if="info.projectNode == 2">成果质检</span>
						<span v-else-if="info.projectNode == 3">领取报告</span>
					</div>
				</div>
			</div>
			<div style="height: 2.5rem;"></div>
			<div class="handle">
				<!-- 领导 -->
				<!-- <div class="handle_btn btn1" v-if="roleCode == 'LeaderRole'&&info.isEvaluationExist == true" @click="evalUrl(info)">查看评价</div>
				<div class="handle_btn btn0" v-if="roleCode == 'LeaderRole'&&info.isEvaluationExist == false">查看评价</div> -->
				<!-- <div class="handle_btn btn2" v-if="roleCode == 'LeaderRole'&&info.isComplaintExist == true" @click="compUrl(info)">查看投诉</div>
				<div class="handle_btn btn0" v-if="roleCode == 'LeaderRole'&&info.isComplaintExist == false" >查看投诉</div> -->
				<!-- 部门领导 -->
				<!-- <div class="handle_btn btn1" v-if="roleCode == 'DepartLeaderRole'&&info.isEvaluationExist == true" @click="evalUrl(info)">查看评价</div>
				<div class="handle_btn btn0" v-if="roleCode == 'DepartLeaderRole'&&info.isEvaluationExist == false">查看评价</div> -->
				<!-- <div class="handle_btn btn2" v-if="roleCode == 'DepartLeaderRole'&&info.isComplaintExist == true" @click="compUrl(info)">查看投诉</div>
				<div class="handle_btn btn0" v-if="roleCode == 'DepartLeaderRole'&&info.isComplaintExist == false" >查看投诉</div> -->
				
				<div v-if="roleAdjust" style="flex: 1;">
					<div class="handle_btn btn1" v-if="roleCode == 'DepartLeaderRole'&&info.applyStatus != 0&&info.busUserStatus != -1" @click="handleUrl(info)">任务调整</div>
				</div>
				<div class="handle_btn btn1" v-if="roleCode == 'ProjectAdmin'&&info.applyStatus != 0&&info.busUserStatus != 1" @click="handleUrl(info)">任务调整</div>
			</div>
		</div>
		<script src="script/jquery-3.5.js"></script>
		<script src="script/vue.js"></script>
		<script src="script/api.js"></script>
		<script src="script/ajax.js"></script>
		<!-- <script src="../js/common/mui.min.js"></script> -->
		<!-- <script src="../js/common/openview.js"></script> -->
		<script>
			var app = new Vue({
				el: '#containerVue',
				data: {
					info: {}, // 详情信息
					roleCode: "", // 角色类型
					roleAdjust: false, // 调整权限
          showBanner:0,
				},
				mounted() {
					this.getRole();
					this.getDetail();
				},
				watch: {},
				methods: {
					getDetail() {
            this.showBanner=localStorage.getItem("showBanner");
						let that = this;
						ajaxHttp({
							url: 'jeecg-boot/node/nodeProjectInfo/getProjectById',
							type: 'post',
							data: {projectId: JSON.parse(sessionStorage.getItem('projectId'))},
							success: function(res) {
								console.log(res);
								if (res.success) {
									that.info = res.result
                  sessionStorage.setItem('indexInfo', JSON.stringify(that.info));
									that.getCode()
								} else {
									$.Jwarning(res.message)
								}
							},
						})
					},
				// 获取部门编码
				getCode() {
					let that = this;
					ajaxHttp({
						url: 'jeecg-boot/node/nodeProjectInfo/getDeptNameByDeptCode',
						type: 'post',
						data: {deptCode: that.info.departmentCode},
						success: function(res) {
							// console.log(JSON.stringify(res));
							if (res.success) {
								Vue.set( that.info, 'deptName', res.message)
							} else {
								$.Jwarning(res.message)
							}
						},
					})
				},
					// 获取角色
					getRole() {
						let that = this;
						ajaxHttp({
							url: 'jeecg-boot/sys/role/queryRoleByUser',
							type: 'post',
							data: {},
							success: function(res) {
								if (res.success) {
									res.result.forEach(item => {
										if (item.roleCode == "ProjectAdmin") { // 经营人员
											that.roleCode = item.roleCode;
										} else if (item.roleCode == "ProjectNodeViewRole") { // 业主
											that.roleCode = item.roleCode;
										} else if (item.roleCode == "LeaderRole") { // 领导
											that.roleCode = item.roleCode;
										} else if (item.roleCode == "DepartLeaderRole") { // 部门领导
											that.roleCode = item.roleCode;
										} else if (item.roleCode == "AdjustHandleRole") { // 调整权限
											that.roleAdjust = true;
										}
									})
								} else {
									$.Jwarning(res.message)
								}
							},
						})
					},
					// 查看调整页面跳转
					taskUrl(item) {
						window.location.href = "taskList.html";
						sessionStorage.setItem('taskInfo', JSON.stringify(item));
					},
					// 查看投诉页面跳转
					compUrl(item) {
						window.location.href = "complaintList.html";
						sessionStorage.setItem('complaintInfo', JSON.stringify(item));
					},
					// 查看评价页面跳转
					evalUrl(item) {
						window.location.href = "evaluateList.html";
						sessionStorage.setItem('evalInfo', JSON.stringify(item));
					},
					// 待处理审批
					handleUrl(item) {
						window.location.href = "index_detail_before.html";
						console.log(JSON.stringify(item));
					},
				}
			})
		</script>
	</body>
</html>
